package com.spukmk3me.math;

/**
 *  Row-major 4x4 matrix.
 */
public interface Matrix4f
{
    public void copy( Matrix4f matrix );
    public void add( Matrix4f matrix );
    public void mul( float n );
    
    /**
     *  Do (this x matrix) and store the result to this object.
     *  @param matrix
     */
    public void mul( Matrix4f matrix );
    
    /**
     *  Do (matrix x this) and store the result to this object.
     *  @param matrix
     */
    public void mul_inv( Matrix4f matrix );
    
    /**
     *  Scale function.
     * @param x
     * @param y
     * @param z
     */
    public void s( float x, float y, float z );
    
    /**
     *  Translate function.
     * @param x
     * @param y
     * @param z
     */
    public void t( float x, float y, float z );
    
    /**
     *  Rotate function
     *  \details x-y-z convention.
     */
    public void r( float x, float y, float z, float angle );
    
    /**
     *  Inverts the matrix. Throws a RuntimeException in case the matrix is not invertible. Stores the result in this matrix.
     *  \details Copied from LibGDX, class Matrix4.
     */
    public void invert();

    public float[] getRawData();
    public void setRawData( float[] data, int offset );
    
    /**
     *  Load the identity (1) matrix.
     */
    public void reset();
    public boolean hasTranslation();
    public boolean hasRotation();
    public boolean hasScaling();
    
    // List of indexes, copied from Libgdx
    public static final int M00 = 0;    // 0
    public static final int M01 = 4;    // 1
    public static final int M02 = 8;    // 2
    public static final int M03 = 12;   // 3
    public static final int M10 = 1;    // 4
    public static final int M11 = 5;    // 5
    public static final int M12 = 9;    // 6
    public static final int M13 = 13;   // 7
    public static final int M20 = 2;    // 8
    public static final int M21 = 6;    // 9
    public static final int M22 = 10;   // 10
    public static final int M23 = 14;   // 11
    public static final int M30 = 3;    // 12
    public static final int M31 = 7;    // 13
    public static final int M32 = 11;   // 14
    public static final int M33 = 15;   // 15
}
